package main

import "fmt"

type Usber interface {
	Start()
	Stop()
}

type Phone struct {
	Name string
}

func (p Phone) Start() {
	fmt.Println(p.Name, "开始工作")
}

func (p Phone) Stop() {
	fmt.Println(p.Name, "结束工作")
}

type Camera struct {
}

func (c Camera) Start() {
	fmt.Println("相机开始工作")
}

func (c Camera) Start2() {
	fmt.Println("相机开始工作")
}

func (c Camera) Stop() {
	fmt.Println("相机结束工作")
}

func main() {

	phone := Phone{
		Name: "苹果17",
	}
	//phone.Start()
	//phone.Stop()

	var p Usber = phone
	p.Start()
	p.Stop()

	camera := Camera{}
	var c Usber = camera
	c.Start()
	c.Stop()

	camera2 := Camera{}
	camera2.Start2()

	show(20)
	show("20")
	show(true)
}

func show(anyting interface{}) {
	fmt.Printf("%T   \t %v \n", anyting, anyting)
}
